﻿@model IEnumerable<BabyShop.WebSite.Models.ProductType>

<aside class="allsort">
    <div class="mt">
        <strong><a href="javascript:void(0);" title="全部商品分类">全部商品分类</a></strong>
        <div class="extra">
            &nbsp;</div>
    </div>
    <div id="sortArea" class="mc">
        @{int i = 0;}
        @foreach (var productType in Model.Where(p => p.ParentGuid == null)) {
            <div class="item @(i++ == 0 ? "fore" : string.Empty)">
                <nav>
                    <h3>
                        @Html.ActionLink(productType)
                    </h3>
                    <s></s>
                </nav>
                @if (productType.ChildProductTypes != null && productType.ChildProductTypes.Count > 0) {
                    <div class="i-mc">
                        <div class="close" onclick="javascript:$(this).parents('.item').removeClass('hover');"></div>
                        <div class="subitem">
                            @{int j = 0;}
                            @foreach (var secondProductType in productType.ChildProductTypes) {
                                <dl class="@(j++ == 0 ? "fore" : string.Empty)">
                                <dt>@Html.ActionLink(secondProductType)</dt>
                                @if (secondProductType.ChildProductTypes != null && secondProductType.ChildProductTypes.Count >0) {
                                    <dd>
                                    @foreach (var thirdProductType in secondProductType.ChildProductTypes) {
                                        <em>
                                        @Html.ActionLink(thirdProductType)
                                        </em>    
                                    }
                                    </dd>
                                }
                                </dl>
                            }
                        </div>
                   </div>
                }
            </div>
        }
    </div>
</aside>
